#ifndef __VS1053_DEFINES
#define __VS1053_DEFINES

/******************************************************************
 * SPI Pins used (in addition to SCK,MOSI,MISO) and their pin val *
 ******************************************************************/
#define vsSCK	(1<<7)
#define vsSO	(1<<6)
#define vsSI	(1<<5)
#define vsCS	(1<<4)
#define vsDCS	(1<<3)
#define vsDREQ	(1<<2)
#define vsReset (1<<1)

// Command values
#define VS_WRITE_REGISTER 0x02
#define VS_READ_REGISTER 0x03

// SPI Clock speeds
#define VS_SPI_SCK_LOWSPEED		0x82 // 1MHZ
#define VS_SPI_SCK_HIGHSPEED	0x81 // 4MHZ

// VS SPI Clock speed
#define VS_CLOCKF_HIGHSPEED		0x8800

#define vsPORT PORTD
#define vsSPI SPID

// Volumen defines
#define VOL_MIN 0xFE
#define VOL_MAX 0x00
#define VOL_DEFAULT 0x10

#define VOL_CHANGE_VAL 16

// Internal VS1053 Registers, found in VS1053 Documentation
enum VS_REGISTER {
	VS_MODE = 0x00,
	VS_STATUS,
	VS_BASS,
	VS_CLOCKF,
	VS_DECODE_TIME,
	VS_AUDATA,
	VS_WRAM,
	VS_WRAMADDR,
	VS_HDAT0,
	VS_HDAT1,
	VS_AIADDR,
	VS_VOL,
	VS_AICTRL0,
	VS_AICTRL1,
	VS_AICTRL2,
	VS_AICTRL3
} VS_REGISTER;

// VS Modes bit positions that can be set in VS_MODE register
enum VS_MODES {
	SM_DIFF = 0,
	SM_LAYER12,
	SM_RESET,
	SM_CANCEL,
	SM_EARSPEAKER_IO,
	SM_TESTS,
	SM_STREAM,
	SM_EARSPEAKER_HI,
	SM_DACT,
	SM_SDIORD,
	SM_SDISHARE,
	SM_SDINEW,
	SM_ADPCM,
	SM_RESERVED_BIT,
	SM_LINE1,
	SM_CLK_RANGE
} VS_MODES;

#endif /* VS1053_DEFINES_H */
